package com.wyzz.hr.bo.impl;

import com.wyzz.hr.bo.IDeptHeadsBo;
import com.wyzz.hr.dao.IDeptHeadsDao;
import com.wyzz.hr.pojo.Deptheads;
import java.util.List;
import org.hibernate.FetchMode;
import org.hibernate.criterion.DetachedCriteria;

public class DeptHeadsBoImpl implements IDeptHeadsBo {

	public DeptHeadsBoImpl() {
	}

	public IDeptHeadsDao getDeptHeadsDao() {
		return deptHeadsDao;
	}

	public void setDeptHeadsDao(IDeptHeadsDao deptHeadsDao) {
		this.deptHeadsDao = deptHeadsDao;
	}

	public List getHeadsByDeptId(String deptId) {
		DetachedCriteria detachedCriteria = DetachedCriteria
				.forClass(com.wyzz.hr.pojo.Deptheads.class);
		detachedCriteria
				.setFetchMode(Deptheads.PROP_DHE_EMP_NO, FetchMode.JOIN);
		List headsList = deptHeadsDao.findByCriteria(detachedCriteria);
		return headsList;
	}

	private IDeptHeadsDao deptHeadsDao;
}
